package com.lesson02;

import java.awt.*;

public class TestPaint {
    public static void main(String[] args) {
        new MyPaint().loadFrame();
    }
}
class MyPaint extends Frame {
    public void loadFrame(){
        setBounds(100,100,600,600);
        setVisible(true);
    }
    @Override
    public void paint(Graphics g) {
        //super.paint(g);
        g.setColor(Color.red);
        //空心⚪
        //g.drawOval(100, 100, 200, 200);
        //实心⚪
        g.fillOval(300, 100, 200, 200);
        g.setColor(Color.blue);
        //画矩形
        g.fillRect(100, 300, 200, 200);
        //画笔用完，还原到原来的颜色
        g.setColor(Color.black);
    }
}